<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>intel-ipsec-mb: intel-ipsec-mb</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">intel-ipsec-mb<span id="projectnumber">&#160;v2.0</span>
   </div>
   <div id="projectbrief">Documentation of the Intel(R) IPSec Multi-Buffer library</div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">intel-ipsec-mb </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md__2home_2mdcornu_2innersource_2libraries_8performance_8ipsec-mb_2README"></a> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/linux.yml/badge.svg" alt="Linux" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/windows.yml/badge.svg" alt="Windows" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/freebsd.yml/badge.svg" alt="FreeBSD" style="pointer-events: none;" class="inline"/> <a href="https://scan.coverity.com/projects/intel-ipsec-mb"><img src="https://scan.coverity.com/projects/16449/badge.svg" alt="Coverity Status" style="pointer-events: none;" class="inline"/></a> <a href="https://securityscorecards.dev/viewer/?uri=github.com/intel/intel-ipsec-mb"><img src="https://api.securityscorecards.dev/projects/github.com/intel/intel-ipsec-mb/badge" alt="OpenSSF Scorecard" class="inline"/></a></p>
<h1><a class="anchor" id="autotoc_md0"></a>
Intel(R) Multi-Buffer Crypto for IPsec Library</h1>
<p>The library provides software crypto acceleration primarily targeting packet processing applications. It can be used for application such as: IPsec, TLS, Wireless (RAN), Cable or MPEG DRM.</p>
<p>The library is hosted on <a href="https://github.com/intel/intel-ipsec-mb">GitHub</a> and is used as software crypto provider in <a href="https://www.dpdk.org/">DPDK</a>, <a href="https://github.com/intel/QAT_Engine">Intel(R) QAT Engine</a> and <a href="https://fd.io/">FD.io</a>.</p>
<p>Using crypto interfaces from the above frameworks gives freedom to change providers without subsequent application modifications. The library can also be used directly through its native API.</p>
<p>Key differentiating features:</p>
<ul>
<li>operation chaining (encryption and authentication)</li>
<li>advanced cryptographic pipelining<ul>
<li>job manager with scheduling and dispatching functions</li>
<li>API hides underlying implementation details from an application</li>
</ul>
</li>
<li>multi-buffer and function stitching innovations</li>
<li>low level implementations using latest instruction extensions</li>
</ul>
<h2><a class="anchor" id="autotoc_md1"></a>
Contents</h2>
<ol type="1">
<li>Overview</li>
<li>Processor Extensions</li>
<li>Recommendations</li>
<li>Package Content</li>
<li>Documentation</li>
<li>Compilation</li>
<li>Installation</li>
<li>Security Considerations &amp; Options for Increased Security</li>
<li>Backwards compatibility</li>
<li>Disclaimer (ZUC, KASUMI, SNOW3G)</li>
<li>Legal Disclaimer</li>
<li>FIPS Compliance</li>
<li>DLL Injection</li>
</ol>
<h2><a class="anchor" id="autotoc_md2"></a>
1. Overview</h2>
<p>Intel Multi-Buffer Crypto for IPsec Library is highly-optimized software implementations of the core cryptographic processing for IPsec, which provides industry-leading performance on a range of Intel(R) Processors.</p>
<p>For information on how the library works, see the Intel White Paper: <a href="https://github.com/intel/intel-ipsec-mb/wiki/doc/fast-multi-buffer-ipsec-implementations-ia-processors-paper.pdf">"Fast Multi-buffer IPsec Implementations on Intel Architecture Processors". Jim Guilford, Sean Gulley, et. al.</a></p>
<p>Table 1. List of supported cipher algorithms and their implementations. </p><div class="fragment"><div class="line">+---------------------------------------------------------------------------------------------------+</div>
<div class="line">|                |                              Implementation                                      |</div>
<div class="line">| Encryption     +----------------------------------------------------------------------------------|</div>
<div class="line">|                | SSE    | SSE    | SSE    | AVX2   | AVX2   | AVX2   | AVX2   | AVX512 | AVX512   |</div>
<div class="line">|                | Type 1 | Type 2 | Type 3 | Type 1 | Type 2 | Type 3 | Type 4 | Type 1 | Type 2   |</div>
<div class="line">|                | [S1]   | [S2]   | [S3]   | [A2-1] | [A2-2] | [A2-3] | [A2-4] | [A3-1] | [A3-2]   |</div>
<div class="line">|----------------+--------+--------+--------+--------+--------+--------+--------+--------+----------|</div>
<div class="line">| AES128-GCM     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y   by32 |</div>
<div class="line">| AES192-GCM     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y   by32 |</div>
<div class="line">| AES256-GCM     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y   by32 |</div>
<div class="line">| AES128-CCM     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES256-CCM     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES128-CBC     | Y(2)   |  &lt;---  |  &lt;---  | Y(2)   |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)     |</div>
<div class="line">| AES192-CBC     | Y(2)   |  &lt;---  |  &lt;---  | Y(2)   |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)     |</div>
<div class="line">| AES256-CBC     | Y(2)   |  &lt;---  |  &lt;---  | Y(2)   |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)     |</div>
<div class="line">| AES128-CTR     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES192-CTR     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES256-CTR     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES128-ECB     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES192-ECB     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES256-ECB     | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| AES128-CFB     | Y(3)   |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)     |</div>
<div class="line">| AES192-CFB     | Y(3)   |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)     |</div>
<div class="line">| AES256-CFB     | Y(3)   |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)     |</div>
<div class="line">| AES128-DOCSIS  | Y(2)   |  &lt;---  |  &lt;---  | Y(2)   |  &lt;---  |  &lt;---  |  &lt;---  | Y(2)   | Y(4)     |</div>
<div class="line">| AES256-DOCSIS  | Y(2)   |  &lt;---  |  &lt;---  | Y(2)   |  &lt;---  |  &lt;---  |  &lt;---  | Y(2)   | Y(4)     |</div>
<div class="line">| DES-DOCSIS     | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y  x16 |  &lt;---    |</div>
<div class="line">| 3DES/TDES      | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y  x16 |  &lt;---    |</div>
<div class="line">| DES            | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y  x16 |  &lt;---    |</div>
<div class="line">| KASUMI-F8      | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---    |</div>
<div class="line">| ZUC-EEA3       | Y   x4 |  &lt;---  | Y(5)x4 | Y  x8  | Y(5)x8 |  &lt;---  |  &lt;---  | Y  x16 | Y(5) x16 |</div>
<div class="line">| ZUC-EEA3-256   | Y   x4 |  &lt;---  | Y(5)x4 | Y  x8  | Y(5)x8 |  &lt;---  |  &lt;---  | Y  x16 | Y(5) x16 |</div>
<div class="line">| SNOW3G-UEA2    | Y   x4 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y  x16 | Y    x16 |</div>
<div class="line">| AES128-CBCS(1) | Y      |  &lt;---  |  &lt;---  | Y(2)   |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(9)     |</div>
<div class="line">| Chacha20       | Y      |  &lt;---  |  &lt;---  | Y      |  &lt;---  |  &lt;---  |  &lt;---  | Y      |  &lt;---    |</div>
<div class="line">| Chacha20 AEAD  | Y      |  &lt;---  |  &lt;---  | Y      |  &lt;---  |  &lt;---  |  &lt;---  | Y      |  &lt;---    |</div>
<div class="line">| SNOW-V         | Y      |  &lt;---  |  &lt;---  | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---    |</div>
<div class="line">| SNOW-V AEAD    | Y      |  &lt;---  |  &lt;---  | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---    |</div>
<div class="line">| PON-CRC-BIP    | Y  by8 |  &lt;---  |  &lt;---  | Y by8  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   by16 |</div>
<div class="line">| SM4-ECB        | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(6)   | [S1]   | [S1]     |</div>
<div class="line">| SM4-CBC        | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(7)   | [S1]   | [S1]     |</div>
<div class="line">| SM4-CTR        | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(8)   | [S1]   | [S1]     |</div>
<div class="line">| SM4-GCM        | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(8)   | [S1]   | [S1]     |</div>
<div class="line">+---------------------------------------------------------------------------------------------------+</div>
</div><!-- fragment --><p> Notes: <br  />
 (1) - Currently 1:9 crypt:skip pattern supported. <br  />
 (2) - Decryption is by8 and encryption is x8. <br  />
 (3) - Single block decryption and encryption. <br  />
 (4) - Decryption is by16 and encryption is x16. <br  />
 (5) - Implementation using GFNI extensions. <br  />
 (6) - Implementation using SM4NI extensions, by16. <br  />
 (7) - Implementation using SM4NI extensions, single block encryption and by16 decryption. <br  />
 (8) - Implementation using SM4NI extensions, by8. <br  />
 (9) - Decryption is by16 and encryption is x12. <br  />
</p>
<p>Legend: <br  />
 <code>byY</code>- single buffer Y blocks at a time <br  />
 <code>xY</code>- Y buffers at a time <br  />
 <code>[xyz]</code>- same as <code>xyz</code> implementation <br  />
 <code>&lt;---</code>- same as the column to the left <br  />
</p>
<p>Table 2. List of supported integrity algorithms and their implementations. </p><div class="fragment"><div class="line">+-----------------------------------------------------------------------------------------------------+</div>
<div class="line">|                   |                             Implementation                                      |</div>
<div class="line">| Integrity         +---------------------------------------------------------------------------------|</div>
<div class="line">|                   | SSE    | SSE    | SSE    | AVX2   | AVX2   | AVX2   | AVX2   | AVX512 | AVX512  |</div>
<div class="line">|                   | Type 1 | Type 2 | Type 3 | Type 1 | Type 2 | Type 3 | Type 4 | Type 1 | Type 2  |</div>
<div class="line">|                   | [S1]   | [S2]   | [S3]   | [A2-1] | [A2-2] | [A2-3] | [A2-4] | [A3-1] | [A3-2]  |</div>
<div class="line">|-------------------+--------+--------+--------+--------+--------+--------+--------+--------+---------|</div>
<div class="line">| AES-XCBC-96       | Y   x4 |  &lt;---  |  &lt;---  | Y   x8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   x16 |</div>
<div class="line">| HMAC-MD5-96       | Y(1)x4 |  &lt;---  |  &lt;---  | Y   x8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---   |</div>
<div class="line">| HMAC-SHA1-96      | Y   x4 | Y(2)x2 |  &lt;---  | Y   x8 | Y(2)x2 |  &lt;---  | [A2-1] | Y  x16 |  &lt;---   |</div>
<div class="line">| HMAC-SHA2-224_112 | Y   x4 | Y(2)x2 |  &lt;---  | Y   x8 | Y(2)x2 |  &lt;---  |  &lt;---  | Y  x16 |  &lt;---   |</div>
<div class="line">| HMAC-SHA2-256_128 | Y   x4 | Y(2)x2 |  &lt;---  | Y   x8 | Y(2)x2 |  &lt;---  |  &lt;---  | Y  x16 |  &lt;---   |</div>
<div class="line">| HMAC-SHA2-384_192 | Y   x2 |  &lt;---  |  &lt;---  | Y   x4 |  &lt;---  |  &lt;---  | Y(6)x2 | Y   x8 |  &lt;---   |</div>
<div class="line">| HMAC-SHA2-512_256 | Y   x2 |  &lt;---  |  &lt;---  | Y   x4 |  &lt;---  |  &lt;---  | Y(6)x2 | Y   x8 |  &lt;---   |</div>
<div class="line">| SHA1              | Y(2)x4 | Y(2)x2 |  &lt;---  | Y   x8 | Y(2)x2 |  &lt;---  | [A2-1] | Y  x16 |  &lt;---   |</div>
<div class="line">| SHA2-224          | Y(2)x4 | Y(2)x2 |  &lt;---  | Y   x8 | Y(2)x2 |  &lt;---  |  &lt;---  | Y  x16 |  &lt;---   |</div>
<div class="line">| SHA2-256          | Y(2)x4 | Y(2)x2 |  &lt;---  | Y   x8 | Y(2)x2 |  &lt;---  |  &lt;---  | Y  x16 |  &lt;---   |</div>
<div class="line">| SHA2-384          | Y   x2 |  &lt;---  |  &lt;---  | Y   x4 |  &lt;---  |  &lt;---  | Y(6)x2 | Y   x8 |  &lt;---   |</div>
<div class="line">| SHA2-512          | Y   x2 |  &lt;---  |  &lt;---  | Y   x4 |  &lt;---  |  &lt;---  | Y(6)x2 | Y   x8 |  &lt;---   |</div>
<div class="line">| AES128-GMAC       | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y  by32 |</div>
<div class="line">| AES192-GMAC       | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y  by32 |</div>
<div class="line">| AES256-GMAC       | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y  by32 |</div>
<div class="line">| AES128-CCM        | Y   x8 |  &lt;---  |  &lt;---  | Y   x8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   x16 |</div>
<div class="line">| AES256-CCM        | Y   x8 |  &lt;---  |  &lt;---  | Y   x8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   x16 |</div>
<div class="line">| AES128-CMAC-96    | Y   x8 |  &lt;---  |  &lt;---  | Y   x8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   x16 |</div>
<div class="line">| AES256-CMAC-96    | Y   x8 |  &lt;---  |  &lt;---  | Y   x8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y   x16 |</div>
<div class="line">| KASUMI-F9         | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---   |</div>
<div class="line">| ZUC-EIA3          | Y   x4 |  &lt;---  | Y(3)x4 | Y   x8 | Y(3)x8 |  &lt;---  |  &lt;---  | Y  x16 | Y(3)x16 |</div>
<div class="line">| ZUC-EIA3-256      | Y   x4 |  &lt;---  | Y(3)x4 | Y   x8 | Y(3)x8 |  &lt;---  |  &lt;---  | Y  x16 | Y(3)x16 |</div>
<div class="line">| SNOW3G-UIA2       | Y(10)  |  &lt;---  |  &lt;---  | Y(10)  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(11)   |</div>
<div class="line">| DOCSIS-CRC32(8)   | Y      |  &lt;---  |  &lt;---  | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y       |</div>
<div class="line">| HEC               | Y      |  &lt;---  |  &lt;---  | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---   |</div>
<div class="line">| POLY1305          | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)   |  &lt;---  | Y      | Y(4)    |</div>
<div class="line">| POLY1305 AEAD     | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(4)   |  &lt;---  | Y      | Y(4)    |</div>
<div class="line">| SNOW-V AEAD       | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y  by32 |</div>
<div class="line">| GHASH             | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y  by32 |</div>
<div class="line">| CRC(7)            | Y  by8 |  &lt;---  |  &lt;---  | Y  by8 |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y  by16 |</div>
<div class="line">| PON-CRC-BIP(9)    | Y      |  &lt;---  |  &lt;---  | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y  by16 |</div>
<div class="line">| SM3               | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(5)x2 | [S1]   |  &lt;---   |</div>
<div class="line">| HMAC-SM3          | Y      |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  |  &lt;---  | Y(5)x2 | [S1]   |  &lt;---   |</div>
<div class="line">| SM4-GCM           | Y      |  &lt;---  |  &lt;---  | Y  by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y  by32 |</div>
<div class="line">+-----------------------------------------------------------------------------------------------------+</div>
</div><!-- fragment --><p> Notes: <br  />
 (1) - MD5 over one block implemented in C. <br  />
 (2) - Implementation using SHANI extensions. <br  />
 (3) - Implementation using GFNI extensions. <br  />
 (4) - Implementation using IFMA extensions. <br  />
 (5) - Implementation using SM3NI extensions. <br  />
 (6) - Implementation using SHA512NI extensions. <br  />
 (7) - Supported CRC types: <br  />
</p><ul>
<li>CRC32: Ethernet FCS, SCTP, WIMAX OFDMA <br  />
</li>
<li>CRC24: LTE A, LTE B <br  />
</li>
<li>CRC16: X25, FP data <br  />
</li>
<li>CRC11: FP header <br  />
</li>
<li>CRC10: IUUP data <br  />
</li>
<li>CRC8: WIMAX OFDMA HCS <br  />
</li>
<li>CRC7: FP header <br  />
</li>
<li>CRC6: IUUP header <br  />
</li>
</ul>
<p>(8) - used only with AES256-DOCSIS and AES128-DOCSIS ciphers. <br  />
 (9) - used only with PON-AES128-CTR cipher. <br  />
 (10) - x4 for init keystream generation, then by4. <br  />
 (11) - x16 for init keystream generation, then by32. <br  />
</p>
<p>Legend: <br  />
 <code>byY</code>- single buffer Y blocks at a time <br  />
 <code>xY</code>- Y buffers at a time <br  />
 <code>[xyz]</code>- same as <code>xyz</code> implementation <br  />
 <code>&lt;---</code>- same as the column to the left <br  />
</p>
<p>Table 3. Encryption and integrity algorithm combinations </p><div class="fragment"><div class="line">+-----------------------------------------------------------------------------+</div>
<div class="line">| Encryption Algorithm                | Allowed Integrity Algorithms          |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-GCM                          | AES128-GMAC                           |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES192-GCM                          | AES192-GMAC                           |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES256-GCM                          | AES256-GMAC                           |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-CCM                          | AES128-CCM                            |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES256-CCM                          | AES256-CCM                            |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| SM4-GCM                             | SM4-GCM                               |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-CBC, AES192-CBC, AES256-CBC, | AES-XCBC-96, AES128-CMAC-96,          |</div>
<div class="line">| AES128-CTR, AES192-CTR, AES256-CTR, | HMAC-SHA1-96, HMAC-SHA2-224_112,      |</div>
<div class="line">| AES128-ECB, AES192-ECB, AES256-ECB, | HMAC-SHA2-256_128, HMAC-SHA2-384_192, |</div>
<div class="line">| AES128-CFB, AES192-CFB, AES256-CFB, | HMAC-SHA2-512_256, NULL, POLY1305,    |</div>
<div class="line">| NULL, Chacha20,                     | AES128-GMAC, AES192-GMAC, AES256-GMAC,|</div>
<div class="line">| AES128-DOCSIS, AES256-DOCSIS,       | GHASH, SM3, HMAC-SM3                  |</div>
<div class="line">| DES-DOCSIS, 3DES, DES,              | ZUC-EIA3, ZUC-EIA3-256, SNOW3G-UIA3,  |</div>
<div class="line">| KASUMI-F8, SNOW-V, SNOW3G-UEA3,     | KASUMI-F9                             |</div>
<div class="line">| ZUC-EEA3, ZUC-EEA3-256,             |                                       |</div>
<div class="line">| SM4-ECB, SM4-CBC, SM4-CTR           |                                       |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-DOCSIS, AES256-DOCSIS        | DOCSIS-CRC32                          |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| PON-AES128-CTR                      | PON-CRC-BIP                           |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| CHACHA20 AEAD                       | POLY1305 AEAD                         |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| SNOW-V AEAD                         | SNOW-V AEAD (GHASH)                   |</div>
<div class="line">+-------------------------------------+---------------------------------------+</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md3"></a>
2. Processor Extensions and Architecture Types</h2>
<p>Table 4. Processor extensions used in the library </p><div class="fragment"><div class="line">+---------------------------------------------------------------------------------------+</div>
<div class="line">| Architecture  | Instruction Extensions                 | Example Products             |</div>
<div class="line">| Type          |                                        |                              |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| SSE Type 1    | SSE4.2, AESNI, PCLMULQDQ, CMOV, BSWAP  | Westmere, Sandy Bridge,      |</div>
<div class="line">|               |                                        | Ivy Bridge, Rangeley, Avoton |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| SSE Type 2    | [SSE Type 1] + SHANI                   | Denverton                    |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| SSE Type 3    | [SSE Type 2] + GFNI                    | Snow Ridge                   |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 1   | [SSE Type 1] + XSAVE, OSXSAVE, AVX,    | Haswell, Broadwell           |</div>
<div class="line">|               | AVX2, BMI2                             |                              |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 2   | [AVX2 Type 1] + SHANI, GFNI, VAES,     | Arizona Beach, Alder Lake    |</div>
<div class="line">|               | VPCLMULQDQ                             | Raptor Lake                  |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 3   | [AVX2 Type 2] + AVX-IFMA               | Sierra Forest                |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 4   | [AVX2 Type 3] + SM3NI, SM4NI, SHA512NI | Lunar Lake                   |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX512 Type 1 | [AVX2 Type 1] + AVX512F, AVX512DQ,     | Sky Lake, Cascade Lake       |</div>
<div class="line">|               | AVX512CD, AVX512BW, AVX512VL           |                              |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX512 Type 2 | [AVX512 Type 1] + SHANI, GFNI,         | Ice Lake, Sapphire Rapids,   |</div>
<div class="line">|               | AVX512-IFMA, VAES, VPCLMULQDQ          | Emerald Rapids               |</div>
<div class="line">+---------------------------------------------------------------------------------------+</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md4"></a>
3. Recommendations</h2>
<p>Legacy or to be avoided algorithms listed in the table below are implemented in the library in order to support legacy applications. Please use corresponding alternative algorithms instead. </p><div class="fragment"><div class="line">+--------------------------------------------------------------+</div>
<div class="line">| # | Algorithm           | Recommendation | Alternative       |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 1 | DES encryption      | Avoid          | AES encryption    |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 2 | 3DES encryption     | Avoid          | AES encryption    |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 3 | HMAC-MD5 integrity  | Legacy         | HMAC-SHA256       |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 4 | AES-ECB encryption  | Avoid          | AES-CBC, AES-CNTR |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 3 | HMAC-SHA1 integrity | Avoid          | HMAC-SHA256       |</div>
<div class="line">+--------------------------------------------------------------+</div>
</div><!-- fragment --><p> Intel(R) Multi-Buffer Crypto for IPsec Library depends on C library and it is recommended to use its latest version.</p>
<p>Applications using the Intel(R) Multi-Buffer Crypto for IPsec Library rely on Operating System to provide process isolation. As the result, it is recommended to use latest Operating System patches and security updates.</p>
<h2><a class="anchor" id="autotoc_md5"></a>
4. Package Content</h2>
<ul>
<li>test - Library test applications</li>
<li>perf - Library performance application</li>
<li>lib - Library source files</li>
<li>lib/x86_64 - Non-SIMD routines</li>
<li>lib/sse_* - Intel(R) SSE optimized routines</li>
<li>lib/avx2_* - Intel(R) AVX2 optimized routines</li>
<li>lib/avx512_* - Intel(R) AVX512 optimized routines</li>
</ul>
<p><b>Note:</b> <br  />
 There is just one branch used in the project. All development is done on the main branch. <br  />
 Code taken from the tip of the main branch should not be considered fit for production. <br  />
</p>
<p>Refer to the releases tab for stable code versions: <br  />
 <a href="https://github.com/intel/intel-ipsec-mb/releases">https://github.com/intel/intel-ipsec-mb/releases</a></p>
<h2><a class="anchor" id="autotoc_md6"></a>
5. Documentation</h2>
<p>Full documentation can be found at: <a href="https://intel.github.io/intel-ipsec-mb">https://intel.github.io/intel-ipsec-mb</a></p>
<p>To generate documentation locally, run: <br  />
 <code>&gt; make doxy</code></p>
<h2><a class="anchor" id="autotoc_md7"></a>
6. Compilation</h2>
<p>Refer to the compilation section of the <a href="https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#compilation">INSTALL</a> file for instructions.</p>
<h2><a class="anchor" id="autotoc_md8"></a>
7. Installation</h2>
<p>Refer to the installation section of the <a href="https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation">INSTALL</a> file for instructions.</p>
<h2><a class="anchor" id="autotoc_md9"></a>
8. Security Considerations &amp; Options for Increased Security</h2>
<p>Refer to the <a href="https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#security-considerations--options-for-increased-security">SECURITY</a> file for security related information.</p>
<h2><a class="anchor" id="autotoc_md10"></a>
9. Backwards compatibility</h2>
<p>In version 1.4, backward compile time symbol compatibility with library version 0.53 has been removed.</p>
<p>Applications are encouraged to use new symbol names introduced in version 0.54.</p>
<p>If required, compatibility symbol mapping can be implemented in the application. See compatibility symbol mapping in v1.3 header file: <a href="https://github.com/intel/intel-ipsec-mb/blob/v1.3/lib/intel-ipsec-mb.h#L246">https://github.com/intel/intel-ipsec-mb/blob/v1.3/lib/intel-ipsec-mb.h#L246</a></p>
<h2><a class="anchor" id="autotoc_md11"></a>
10. Disclaimer (ZUC, KASUMI, SNOW3G)</h2>
<p>Please note that cryptographic material, such as ciphering algorithms, may be subject to national regulations. What is more, use of some algorithms in real networks and production equipment can be subject to agreement or licensing by the GSMA and/or the ETSI.</p>
<p>For more details please see: <br  />
</p><ul>
<li>GSMA <a href="https://www.gsma.com/security/security-algorithms/">https://www.gsma.com/security/security-algorithms/</a> <br  />
</li>
<li>ETSI <a href="https://www.etsi.org/security-algorithms-and-codes/cellular-algorithm-licences">https://www.etsi.org/security-algorithms-and-codes/cellular-algorithm-licences</a></li>
</ul>
<h2><a class="anchor" id="autotoc_md12"></a>
11. Legal Disclaimer</h2>
<p>THIS SOFTWARE IS PROVIDED BY INTEL"AS IS". NO LICENSE, EXPRESS OR <br  />
 IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS <br  />
 ARE GRANTED THROUGH USE. EXCEPT AS PROVIDED IN INTEL'S TERMS AND <br  />
 CONDITIONS OF SALE, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL <br  />
 DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR <br  />
 USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO <br  />
 FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT <br  />
 OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. <br  />
</p>
<h2><a class="anchor" id="autotoc_md13"></a>
12. FIPS Compliance</h2>
<p>The library does not fulfill technical requirements to achieve Cryptographic Module (CMVP) certification as a standalone component. It is fit for Cryptographic Algorithm validation and certification (CAVP) and it can be part of CMVP as one of the components.</p>
<h3><a class="anchor" id="autotoc_md14"></a>
CAVP</h3>
<p>ACVP test application located in <code>test</code> directory is to support CAVP process. It implements validation of the following algorithms: <br  />
</p><ul>
<li>AES-GCM <br  />
</li>
<li>AES-GMAC <br  />
</li>
<li>AES-CCM <br  />
</li>
<li>AES-CBC <br  />
</li>
<li>AES-EBC</li>
<li>AES-CFB</li>
<li>TDES-EDE-CBC <br  />
</li>
<li>AES-CTR <br  />
</li>
<li>AES-CMAC <br  />
</li>
<li>SHA1 (SHA-1) <br  />
</li>
<li>SHA224 (SHA2-224) <br  />
</li>
<li>SHA256 (SHA2-256) <br  />
</li>
<li>SHA384 (SHA2-384) <br  />
</li>
<li>SHA512 (SHA2-512) <br  />
</li>
<li>HMAC-SHA1 (HMAC-SHA-1) <br  />
</li>
<li>HMAC-SHA224 (HMAC-SHA2-224) <br  />
</li>
<li>HMAC-SHA256 (HMAC-SHA2-256) <br  />
</li>
<li>HMAC-SHA384 (HMAC-SHA2-384) <br  />
</li>
<li>HMAC-SHA512 (HMAC-SHA2-512) <br  />
</li>
</ul>
<p>Note: the acvp-app requires libacvp 2.0+ to be built.</p>
<h3><a class="anchor" id="autotoc_md15"></a>
CAVP Algorithm Parameters</h3>
<p><b>Note:</b> all sizes in bits </p><div class="fragment"><div class="line">+--------------------------------------------------------------------------------------------+</div>
<div class="line">| Algorithm           | Standard  | Parameters                                               |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-GCM             | SP800-38D | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|                     |           | ivLen: [min = 8, max = 1024, increment 8]                |</div>
<div class="line">|                     |           | tagLen: 32, 64, 96, 104, 112, 120, 128                   |</div>
<div class="line">|                     |           | payloadLen: [min = 0, max = 65536, increment = 8]        |</div>
<div class="line">|                     |           | aadLen: [min = 0, max = 65536, increment = 8]            |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CBC             | SP800-38A | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CTR             | SP800-38A | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|                     |           | payloadLen: [min = 8, max = 128, increment = 8]          |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-ECB             | SP800-38A | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CFB128          | SP800-38A | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| TDES-EDE-CBC        | SP800-38A | Key size: 192                                            |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA1 (SHA-1)        | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA224 (SHA2-224)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA256 (SHA2-256)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA384 (SHA2-384)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA512 (SHA2-512)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CCM             | SP800-38C | Key size: 128, 256                                       |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|                     |           | ivLen: [min = 56, max = 104, increment 8]                |</div>
<div class="line">|                     |           | tagLen: 32, 48, 64, 80, 96, 112, 128                     |</div>
<div class="line">|                     |           | payloadLen: [min = 0, max = 256, increment = 8]          |</div>
<div class="line">|                     |           | aadLen: [min = 0, max = 368, increment = 8]              |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-GMAC            | SP800-38B | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | ivLen: [min = 8, max = 1024, increment 8]                |</div>
<div class="line">|                     |           | tagLen: 32, 64, 96, 104, 112, 120, 128                   |</div>
<div class="line">|                     |           | aadLen: [min = 0, max = 65536, increment = 8]            |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CMAC            | SP800-38B | Key size: 128, 256                                       |</div>
<div class="line">|                     |           | msgLen: [min = 8, max = 65528, increment 8]              |</div>
<div class="line">|                     |           | macLen: [min = 8, max = 128, increment = 8]              |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA1           | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA-1)        |           | macLen: [min = 32, max = 160, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA224         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-224)     |           | macLen: [min = 32, max = 224, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA256         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-256)     |           | macLen: [min = 32, max = 256, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA384         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-384)     |           | macLen: [min = 32, max = 384, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA512         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-512)     |           | macLen: [min = 32, max = 512, increment = 8]             |</div>
<div class="line">+--------------------------------------------------------------------------------------------+</div>
</div><!-- fragment --> <h3><a class="anchor" id="autotoc_md16"></a>
Self-Test</h3>
<p>In order to support CMVP, the library implements Self-Test functionality that is available with all compilation options. The test is always performed as part of library initialization (power-up). There is no conditional self-test functionality as none of such conditions occur (i.e. pair-wise consistency test, software/firmware load test, manual key entry test, continuous random number generator test, and bypass test).</p>
<p>Application can register self-test callback function to track test progress. Optionally application can corrupt input message for selected tests and observe change in the test result.</p>
<p>Example sequence of callbacks received by an application is:</p><ul>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_START, data.type = IMB_SELF_TEST_TYPE_KAT_CIPHER, data.descr = "AES128-CBC") =&gt; return 1</li>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_CORRUPT)<ul>
<li>return 1: no message corruption</li>
<li>return 0: corrupt single bit in the 1st byte</li>
</ul>
</li>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_PASS or IMB_SELF_TEST_PHASE_PASS) =&gt; return 1</li>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_START, data.type = IMB_SELF_TEST_TYPE_KAT_CIPHER, data.descr = "AES192-CBC") =&gt; return 1</li>
<li>... Note that value returned by application self-test callback function only matters in the corrupt phase.</li>
</ul>
<p>The self-test consists of Cryptographic algorithm test (known answer test) on following types and algorithms: <br  />
</p><ul>
<li>KAT_AEAD:<ul>
<li>AES-GCM <br  />
</li>
<li>AES-CCM <br  />
</li>
</ul>
</li>
<li>KAT_Cipher:<ul>
<li>AES-CBC <br  />
</li>
<li>AES-CTR <br  />
</li>
<li>AES-ECB <br  />
</li>
<li>AES-CFB</li>
<li>TDES-EDE-CBC <br  />
</li>
</ul>
</li>
<li>KAT_Auth:<ul>
<li>AES-GMAC <br  />
</li>
<li>AES-CMAC <br  />
</li>
<li>SHA1 <br  />
</li>
<li>SHA224 <br  />
</li>
<li>SHA256 <br  />
</li>
<li>SHA384 <br  />
</li>
<li>SHA512 <br  />
</li>
<li>HMAC-SHA1 <br  />
</li>
<li>HMAC-SHA224 <br  />
</li>
<li>HMAC-SHA256 <br  />
</li>
<li>HMAC-SHA384 <br  />
</li>
<li>HMAC-SHA512 <br  />
</li>
</ul>
</li>
</ul>
<p>KAT_Cipher and KAT_AEAD types conduct tests in encrypt and decrypt cipher directions. However, the corrupt callback is made only for the encrypt direction. No callback is made for the decrypt direction at the moment.</p>
<p>Example detection of library self-test completion &amp; error in the application: </p><div class="fragment"><div class="line">IMB_ARCH arch;</div>
<div class="line">IMB_MGR *p_mgr = alloc_mb_mgr(0);</div>
<div class="line"> </div>
<div class="line">init_mb_mgr_auto(p_mgr, &amp;arch); /* or init_mb_mgr_sse/avx/avx2/avx512 */</div>
<div class="line"> </div>
<div class="line">/*</div>
<div class="line"> * check for self-test presence and successful</div>
<div class="line"> * - requires library version v1.3 or newer</div>
<div class="line"> */</div>
<div class="line">if (p_mgr-&gt;features &amp; IMB_FEATURE_SELF_TEST) {</div>
<div class="line">        /* self-test feature present */</div>
<div class="line">        if (p_mgr-&gt;features &amp; IMB_FEATURE_SELF_TEST_PASS) {</div>
<div class="line">                printf(&quot;SELF-TEST: PASS\n&quot;);</div>
<div class="line">        } else {</div>
<div class="line">                printf(&quot;SELF-TEST: FAIL\n&quot;);</div>
<div class="line">        }</div>
<div class="line">} else {</div>
<div class="line">        printf(&quot;SELF-TEST: N/A (requires library &gt;= v1.3)\n&quot;);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line">/* check for initialization self-test error */</div>
<div class="line">if (imb_get_errno(p_mgr) == IMB_ERR_SELFTEST) {</div>
<div class="line">        /* self-test error */</div>
<div class="line">        exit(EXIT_FAILURE);</div>
<div class="line">}</div>
</div><!-- fragment --><p>Example registration of self-test callback function: </p><div class="fragment"><div class="line">int self_test_corrupt = 0;</div>
<div class="line"> </div>
<div class="line">int callback(void *arg, const IMB_SELF_TEST_CALLBACK_DATA *data)</div>
<div class="line">{</div>
<div class="line">        const char *phase = &quot;&quot;;</div>
<div class="line">        const char *type = &quot;&quot;;</div>
<div class="line">        const char *descr = &quot;&quot;;</div>
<div class="line"> </div>
<div class="line">        (void) arg;</div>
<div class="line"> </div>
<div class="line">        if (data != NULL) {</div>
<div class="line">                if (data-&gt;phase != NULL)</div>
<div class="line">                        phase = data-&gt;phase;</div>
<div class="line">                if (data-&gt;type != NULL)</div>
<div class="line">                        type = data-&gt;type;</div>
<div class="line">                if (data-&gt;descr != NULL)</div>
<div class="line">                        descr = data-&gt;descr;</div>
<div class="line">        }</div>
<div class="line"> </div>
<div class="line">        if (strcmp(phase, IMB_SELF_TEST_PHASE_START) == 0)</div>
<div class="line">                printf(&quot;%s : %s : &quot;, type, descr);</div>
<div class="line"> </div>
<div class="line">        if ((strcmp(phase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) &amp;&amp; (self_test_corrupt == 1))</div>
<div class="line">                return 0; /* corrupt input message */</div>
<div class="line"> </div>
<div class="line">        if (strcmp(phase, IMB_SELF_TEST_PHASE_PASS) == 0 ||</div>
<div class="line">            strcmp(phase, IMB_SELF_TEST_PHASE_FAIL) == 0)</div>
<div class="line">                printf(&quot;%s\n&quot;, phase);</div>
<div class="line"> </div>
<div class="line">        return 1;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line">...</div>
<div class="line"> </div>
<div class="line">IMB_ARCH arch;</div>
<div class="line">IMB_MGR *p_mgr = alloc_mb_mgr(0);</div>
<div class="line"> </div>
<div class="line">/*</div>
<div class="line"> * Register self-test callback that will be invoked during</div>
<div class="line"> * subsequent init operation</div>
<div class="line"> */</div>
<div class="line">imb_self_test_set_cb(p_mgr, callback, NULL);</div>
<div class="line"> </div>
<div class="line">init_mb_mgr_auto(p_mgr, &amp;arch); /* or init_mb_mgr_sse/avx/avx2/avx512 */</div>
<div class="line"> </div>
<div class="line">...</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md17"></a>
13.DLL Injection Attack</h2>
<h3><a class="anchor" id="autotoc_md18"></a>
Problem</h3>
<p>The Windows OS has an insecure predefined search order and set of defaults when trying to locate a resource. If the resource location is not specified by the software, an attacker need only place a malicious version in one of the locations Windows will search, and it will be loaded instead. Although this weakness can occur with any resource, it is especially common with DLL files.</p>
<h3><a class="anchor" id="autotoc_md19"></a>
Solutions</h3>
<p>Applications using intel-ipsec-mb DLL library may need to apply one of the solutions to prevent from DLL injection attack.</p>
<p>Two solutions are available:</p><ul>
<li>Using a Fully Qualified Path is the most secure way to load a DLL <br  />
</li>
<li>Signature verification of the DLL <br  />
</li>
</ul>
<h3><a class="anchor" id="autotoc_md20"></a>
Resources and Solution Details</h3>
<ul>
<li>Security remarks section of LoadLibraryEx documentation by Microsoft: <a href="https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa#security-remarks">https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa#security-remarks</a> <br  />
</li>
<li>Microsoft Dynamic Link Library Security article: <a href="https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security">https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security</a> <br  />
</li>
<li>Hijack Execution Flow: DLL Search Order Hijacking: <a href="https://attack.mitre.org/techniques/T1574/001">https://attack.mitre.org/techniques/T1574/001</a> <br  />
</li>
<li>Hijack Execution Flow: DLL Side-Loading: <a href="https://attack.mitre.org/techniques/T1574/002">https://attack.mitre.org/techniques/T1574/002</a> <br  />
 </li>
</ul>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
